#define _CRT_SECURE_NO_WARNINGS

#include<stdio.h>
void swap(int* p1, int* p2)
{
	int tmp = *p1;
	*p1 = *p2;
	*p2 = tmp;
}
void PubSort(int* p,int size)
{
	int i = 0, j = 0;
	for (i = 0; i < size-1; i++)
	{
		int flag = 1;
		for (j = 0; j < size - 1 - i; j++)
		{
			flag = 0;
			if (p[j] < p[j + 1])
				swap(&p[j], &p[j + 1]);
		}
		if(flag)
			break;
	}
	for (i = 0; i < size; i++)
	{
		printf("%d ", p[i]);
	}
}
int main()
{
	int arr[] = { 6,3,8,9,3,9,1,0,12,7 };
	int len = sizeof(arr) / sizeof(arr[0]);
	PubSort(arr,len);

	return 0;
}